import request from './wrapRequest';

/**
 * 用户列表
 * @param data 
 * @returns 
 */
import { UserProps } from '@/types/userTypes';


/**
 * 暂时不做分页
 * @returns 
 */
export const fetchList = () => {
  return  request.get<UserProps[]>(`/admin/user/list`);
}

/**
 * 增加用户
 * @param data 
 * @returns 
 */
export const addUser = (data: UserProps) => {
  return  request.put<boolean>(`/admin/user/create`, data);
}

/**
 * 删除用户
 * @param data 
 * @returns 
 */
export const deleteUser = (data: UserProps) => {
  return  request.delete<boolean>(`/admin/user/delete/`+ data._id);
}